load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "httputil",
    srcs = [
        "client.go",
        "compute_etags.go",
        "handlers.go",
        "http.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/util/httputil",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/protoutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//jsonpb",
    ],
)

go_test(
    name = "httputil_test",
    srcs = [
        "compute_etags_test.go",
        "etag_handler_test.go",
    ],
    embed = [":httputil"],
    deps = [
        "//pkg/util/assetbundle",
        "//pkg/util/leaktest",
        "@com_github_klauspost_compress//zstd",
        "@com_github_stretchr_testify//require",
    ],
)
